package com.yootk.action;

import com.yootk.action.abs.AbstractAction;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.Map;

@Controller
@RequestMapping("/pages/header/*")
public class HeaderAction extends AbstractAction {
    @GetMapping("get")
    @ResponseBody
    public Object get(
            @RequestHeader(name = "yootk",defaultValue = "sun.java") String yootk ,
            @RequestHeader("Accept-Encoding") String acceptEncoding,
            @RequestHeader("user-Agent") String userAgent,
            @RequestHeader("cookie") String cookie
    ){
        Map<String,String> map = new HashMap<>() ;
        map.put("yootk",yootk) ;
        map.put("acceptEncoding",acceptEncoding) ;
        map.put("userAgent",userAgent) ;
        map.put("cookie",cookie) ;
        return map ;
    }
}
